<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderShirtTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_shirt', function (Blueprint $table) {
            $table->increments('id');
            $table->string('order_number', 100)->comment('订单号');
            $table->decimal('amount', 10, 2)->default(0.00)->comment('订单合计总价，包含运费');
            $table->decimal('order_amount', 10, 2)->default(0.00)->comment('订单总价，不包含运费');
            $table->decimal('shipping', 10, 2)->default(0.00)->comment('运费');
            $table->tinyInteger('status')->default(0)->comment('订单状态');
            $table->tinyInteger('payment_status')->default(0)->comment('支付状态');
            $table->integer('payment_at')->nullable()->comment('支付时间');
            $table->string('order_from', 50)->nullable()->comment('订单来源');
            $table->string('openid', 150)->nullable()->comment('微信openID');
            $table->string('unionid', 150)->nullable()->comment('微信unionID');
            $table->string('wechat_nickname', 150)->nullable()->comment('微信昵称');
            $table->string('shirt_mianliao', 100)->comment('面料');
            $table->string('shirt_lingxing', 100)->comment('领型');
            $table->string('shirt_xiuxing', 100)->comment('袖型');
            $table->string('shirt_xiuzi', 100)->comment('绣字位置');
            $table->string('shirt_xiuzicolor', 100)->comment('绣字颜色');
            $table->string('shirt_xiuzicontent', 100)->comment('绣字内容');
            $table->integer('height')->comment('身高，单位CM');
            $table->integer('weight')->comment('体重，单位KG');
            $table->string('shirt_xiongxing', 100)->comment('胸型');
            $table->string('shirt_jianxing', 100)->comment('肩型');
            $table->string('shirt_fuxing', 100)->comment('腹型');
            $table->string('shirt_beibu', 100)->comment('背部');
            $table->char('recipient_phone', 11)->comment('收件人电话');
            $table->string('recipient_name', 100)->comment('收件人姓名');
            $table->string('recipient_area', 100)->comment('收件人地区');
            $table->string('recipient_address', 100)->comment('收件人地址');
            $table->char('buyer_phone', 11)->comment('购买人电话');
            $table->text('remarks')->nullable()->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_shirt');
    }
}
